package com.ucode.application.form.acis;

import java.io.Serializable;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import com.ucode.acis.mode.FamousExpert;
import com.ucode.springboot.starter.web.validator.group.AddGroup;
import com.ucode.springboot.starter.web.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(value="名家")
@SuppressWarnings("serial")
public class FamousExpertForm implements Serializable{
    /**
     * 姓名
     */
    @ApiModelProperty(value = "名称",required=true)
    @NotBlank(message = "名称不能为空", groups = {AddGroup.class,UpdateGroup.class})
    @Length(max=50,message = "名称最大50个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String name;
    /**
     * 别称
     */
    @ApiModelProperty(value = "别称",required=false)
    @Length(max=50,message = "别称最大50个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String nickname;
    /**
     * 字号/笔名
     */
    @ApiModelProperty(value = "别称",required=false)
    @Length(max=50,message = "别称最大50个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String penName;
    /**
     * 出生地
     */
    @ApiModelProperty(value = "出生地",required=false)
    @Length(max=100,message = "出生地最大100个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String hometown;
    /**
     * 出生日期
     */
    @ApiModelProperty(value = "出生日期",required=false)
    @Length(max=20,message = "出生日期最大20个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String birthDate;
    /**
     * 逝世日期
     */
    @ApiModelProperty(value = "逝世日期",required=false)
    @Length(max=20,message = "逝世日期最大20个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String deathDate;
    /**
     * 所处年代
     */
    @ApiModelProperty(value = "所处年代",required=false)
    private Integer era;
    /**
     * 民族
     */
    @ApiModelProperty(value = "民族",required=false)
    @Length(max=50,message = "民族最大20个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String ethnic;
    /**
     * 封面图片Id
     */
    @ApiModelProperty(value = "封面图片Id",required=true)
    @NotNull(message="封面图片不能为空", groups = {AddGroup.class,UpdateGroup.class})
    private Long coverId;
    /**
     * 摘要
     */
    @ApiModelProperty(value = "摘要",required=false)
    @Length(max=300,message = "摘要最大300个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String summary;
    /**
     * 人物简介
     */
    @ApiModelProperty(value = "人物简介",required=false)
    private String intro;
    /**
     * 排序
     */
    @ApiModelProperty(value = "排序号",required=false)
    private Integer sort;
    
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getNickname() {
        return nickname;
    }
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }
    public String getPenName() {
        return penName;
    }
    public void setPenName(String penName) {
        this.penName = penName;
    }
    public String getHometown() {
        return hometown;
    }
    public void setHometown(String hometown) {
        this.hometown = hometown;
    }
    public String getBirthDate() {
        return birthDate;
    }
    public void setBirthDate(String birthDate) {
        this.birthDate = birthDate;
    }
    public String getDeathDate() {
        return deathDate;
    }
    public void setDeathDate(String deathDate) {
        this.deathDate = deathDate;
    }
    public Integer getEra() {
        return era;
    }
    public void setEra(Integer era) {
        this.era = era;
    }
    public String getEthnic() {
        return ethnic;
    }
    public void setEthnic(String ethnic) {
        this.ethnic = ethnic;
    }
    public Long getCoverId() {
        return coverId;
    }
    public void setCoverId(Long coverId) {
        this.coverId = coverId;
    }
    public String getSummary() {
        return summary;
    }
    public void setSummary(String summary) {
        this.summary = summary;
    }
    public String getIntro() {
        return intro;
    }
    public void setIntro(String intro) {
        this.intro = intro;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    
    public FamousExpert build(){
        FamousExpert famousExpert = new FamousExpert();
        famousExpert.setName(this.name);
        famousExpert.setNickname(nickname);
        famousExpert.setPenName(penName);
        famousExpert.setHometown(hometown);
        famousExpert.setBirthDate(birthDate);
        famousExpert.setDeathDate(deathDate);
        famousExpert.setEra(era);
        famousExpert.setEthnic(ethnic);
        famousExpert.setCoverId(coverId);
        famousExpert.setSummary(summary);
        famousExpert.setIntro(intro);
        famousExpert.setSort(sort);
        return famousExpert;
    }

}
